package com.example.shuiyin.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import com.example.shuiyin.security.JwtTokenProvider;
import lombok.extern.slf4j.Slf4j;

/**
 * JWT配置类
 * 负责创建JwtTokenProvider Bean，并注入JwtProperties
 * JwtProperties通过@ConfigurationProperties自动从配置文件中加载jwt前缀的配置
 */
@Configuration
@Slf4j
public class JwtConfig {
    
    @Bean
    @Primary
    public JwtTokenProvider jwtTokenProvider(JwtProperties jwtProperties) {
        log.info("创建JwtTokenProvider Bean，JwtProperties: {}", jwtProperties);
        return new JwtTokenProvider(jwtProperties);
    }
} 